package com.huadao.cart_ccs.modle;

import com.huadao.cart_ccs.base.BaseSerialPortModel;
import com.huadao.cart_ccs.common.ByteUtils;
import com.huadao.cart_ccs.data.bo.CommandWord;
import com.huadao.cart_ccs.data.bo.ElectronicScaleBO;
import com.huadao.cart_ccs.data.bo.Protocol;

/**
 * 电子秤
 */
public class ElectronicScaleModle extends BaseSerialPortModel {

    private String TAG="电子秤";

    //ad值位0000，则由下位机自动去皮
    public void peel(byte[] ad){
        Protocol params = ByteUtils.generateProtocol(CommandWord.write, new byte[]{ElectronicScaleBO.ModularType_ElectronicScale,ElectronicScaleBO.electronicScale_NO1,ElectronicScaleBO.peel}, ad);
        serialPortRequest(params);
    }

    public void weight(){
        Protocol params = ByteUtils.generateProtocol(CommandWord.read, new byte[]{ElectronicScaleBO.ModularType_ElectronicScale,ElectronicScaleBO.electronicScale_NO1,ElectronicScaleBO.read}, null);
        serialPortRequest(params);
    }

}
